Algorithms for Data-race Detection in Multithreaded Programs Algorithms for Data-race Detection in Multithreaded Programs

نویسندگان

  • Guang-Ien Cheng
  • Charles E. Leiserson
  • Arthur C. Smith
چکیده

If two parallel threads access the same location and at least one of them performs a write, a race exists. The detection of races|a major problem in parallel debugging|is complicated by the presence of atomic critical sections. In programs without critical sections, the existence of a race is usually a bug leading to nondeterministic behavior. In programs with critical sections, however, accesses in parallel critical sections are not considered bugs, as the programmer, in specifying the critical sections, presumably intends them to run in parallel. Thus, a race detector should nd \data races"|races between accesses not contained in atomic critical sections. We present algorithms for detecting data races in programs written in the Cilk multi-threaded language. These algorithms do not verify programs, but rather nd data races in all schedulings of the computation generated when a program executes serially on a given input. We present two algorithms for programs in which atomicity is speciied using locks, and an algorithm for programs using a proposed \guard statement" language construct to specify atomicity at a higher level than locks. We also extend each algorithm to handle critical sections containing parallelism. We present the following algorithms, each characterized roughly in terms of the factor by which it slows down the computation being checked. In each case, memory usage is increased by roughly the same factor, unless otherwise stated. All-Sets. This algorithm checks programs with locks, with a slowdown factor of kL, where k is the maximum number of locks held simultaneously, and L is the maximum number of combinations of locks held during accesses to any particular location. Brelly. This algorithm checks programs with locks, with a slowdown factor of only k. The gain in eeciency comes at the cost of exibility and precision, since Brelly detects violations of a proposed locking discipline that precludes some race-free locking protocols as well as data races. Review-Guards. This algorithm checks programs with guard statements, with a slowdown factor of lg k, where k is the maximum number of simultaneously guarded memory blocks. Space usage is increased by a constant factor. The extensions of All-Sets and Brelly that handle critical sections containing parallelism run a factor of k slower than the originals. The extension of Review-Guards achieves the same performance as the original. Acknowledgments Charles Leiserson is the very best of advisors, and I am grateful to him for his generous , patient, and wise guidance, …

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Goblint : PATH - SENSITIVE DATA RACE ANALYSIS 1

We present Goblint, a static analyzer for detecting potential data races in the multithreaded C code. The implemented analysis is sound on a “safe” subset of C and sufficiently efficient to be used for race-detection of multithreaded programs up to about 25 thousand lines of code. It uses a global invariant approach to avoid the state space explosion problem and is both contextand path-sensitive.

متن کامل

Goblint: Path-Sensitive Data Race Analysis

We present Goblint, a static analyzer for detecting potential data races in the multithreaded C code. The implemented analysis is sound on a “safe” subset of C and sufficiently efficient to be used for race-detection of multithreaded programs up to about 25 thousand lines of code. It uses a global invariant approach to avoid the state space explosion problem and is both contextand path-sensitive.

متن کامل

Effective Monitoring Memory Operations for Dynamic Race Detection through Hierarchical Filtering Method

Data races are the hardest defect to handle in multithreaded programs due to the nondeterministic interleaving of concurrent threads. It incurs the expensive costs of dynamic data race detection to monitor all of memory operations to shared memory locations. This paper presents a hierarchical filtering method that removes unnecessary monitoring memory operations from three levels of binary imag...

متن کامل

Algorithms for Data-Race Detection in Multithreaded Programs

If two parallel threads access the same location and at least one of them performs a write, a race exists. The detection of races|a major problem in parallel debugging|is complicated by the presence of atomic critical sections. In programs without critical sections, the existence of a race is usually a bug leading to nondeterministic behavior. In programs with critical sections, however, access...

متن کامل

Simple thread semantics require race detection

Data race detectors are commonly viewed as debugging tools. We argue that if we knew how to make them both fully accurate and sufficiently fast for “always on” use, they could address an additional and much more foundational role: They would allow us to give precise, simple, and safe semantics to shared variables in multithreaded programs, a problem that has so far defied a complete solution.

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1997